const express = require('express');
const router = express.Router();
const { auth } = require('../middleware/auth');
const {
  register,
  login,
  getCurrentUser,
  updateUser
} = require('../controllers/authController');

// 注册
router.post('/register', register);

// 登录
router.post('/login', login);

// 获取当前用户信息
router.get('/me', auth, getCurrentUser);

// 更新用户信息
router.put('/me', auth, updateUser);

module.exports = router; 